package org.wishwork.api.product.shop;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.wishwork.api.product.shop.query.ShopProductQueryApi;
import org.wishwork.api.product.shop.query.ShopProductQueryRequest;
import org.wishwork.api.product.shop.query.ShopProductQueryResponse;
import org.wishwork.api.product.shop.upload.ShopProductUploadApi;
import org.wishwork.api.product.shop.upload.ShopProductUploadRequest;
import org.wishwork.api.product.shop.upload.ShopProductUploadResponse;
import org.wishwork.context.Context;

import java.util.List;

/**
 * @description: 店铺商品资料
 * @author: WangYX
 * @create: 2022-04-11 14:36
 * @Version: 1.0.0
 **/

public class ShopProductApi {

    private static final Logger log = LoggerFactory.getLogger(ShopProductApi.class);

    private Context context;

    private final ShopProductQueryApi shopProductQueryApi;

    private final ShopProductUploadApi shopProductUploadApi;

    public ShopProductApi(Context context) {
        this.context = context;
        this.shopProductQueryApi = new ShopProductQueryApi(context);
        this.shopProductUploadApi = new ShopProductUploadApi(context);
    }

    /**
     * 店铺商品资料查询
     *
     * @param shopProductQueryRequest
     * @return
     * @throws Exception
     */
    public List<ShopProductQueryResponse> query(ShopProductQueryRequest shopProductQueryRequest) throws Exception {
        return this.shopProductQueryApi.business(shopProductQueryRequest);
    }

    /**
     * 店铺商品资料上传
     *
     * @param shopProductUploadRequests
     * @return
     * @throws Exception
     */
    public ShopProductUploadResponse upload(List<ShopProductUploadRequest> shopProductUploadRequests) throws Exception {
        return this.shopProductUploadApi.business(shopProductUploadRequests);
    }


}
